//
//  MineViewController.m
//  meiquan
//
//  Created by hejingjin on 2017/10/21.
//  Copyright © 2017年 mq. All rights reserved.
//

#import "MineViewController.h"
#import "MQSealCenterview.h"
#import "ApplicationButton.h"
#import "MQUserinfoviewViewController.h"
@interface MineViewController ()

@property(nonatomic,strong)UIScrollView *bgscrollview;

@end

@implementation MineViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    [self setUpMainInterface];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)setUpMainInterface{
    
    
    _bgscrollview = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, BSTScreenW, BSTScreenH)];
    
    MQSealCenterview *topview = [MQSealCenterview mQSealCenterview];
    topview.bst_x = 0;
    topview.bst_y = 0;
    topview.bst_height = 180 *Persion;
    topview.bst_width = BSTScreenW;
    //    [self.view addSubview:topview];
    topview.iconimageview.image = [UIImage imageNamed:@"gerenzx_wodejif"];
    [_bgscrollview addSubview:topview];
    
    
    UIView *firstview = [[UIView alloc] initWithFrame:CGRectMake(0, MAX_Y(topview.frame) + 10, BSTScreenW, 205 * Persion)];
    firstview.backgroundColor = [UIColor whiteColor];
    
    for (int i = 0; i < 1; i++) {
        ApplicationButton *button = [ApplicationButton applicationButton];
        NSInteger col = i/4;
        NSInteger row = i%4;
        button.bst_x = 27 * Persion + row * (90 * Persion);
        button.bst_y =  col *110 + 15 * Persion;
        button.bst_width = 50 * Persion;
        button.bst_height =  70 * Persion;
        button.applicationLabels.text = @"个人资料";
        button.buttons.tag = 10000 + i;
        [button.buttons addTarget:self action:@selector(buttonsPressed:) forControlEvents:UIControlEventTouchUpInside];
        button.iconimageview.image = [UIImage imageNamed:@"gerenzx_gerenzil"];
        [firstview addSubview:button];
        
    }
    
    //    [self.view addSubview:firstview];
    [_bgscrollview addSubview:firstview];
     [_bgscrollview setContentSize:CGSizeMake(BSTScreenW, MAX_Y(firstview.frame) + 20)]
    ;
    [self.view addSubview:_bgscrollview];
    self.view.backgroundColor = BSTColorFromRGB(0xefefef);
    
}

-(void)buttonsPressed:(UIButton *)sender{
    MQUserinfoviewViewController *userinfovc = [[MQUserinfoviewViewController alloc] init];
    userinfovc.title = @"个人中心";
    [self.navigationController pushViewController:userinfovc animated:YES];
}

@end
